//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
////逗号表达式
//struct student
//{
//	char name[20];
//	int grade;
//	char gender[10];
//};
//int main()
//{
//	struct student stu;
//	struct student* ps = &stu;
//	stu.name =  "花骨朵" ;
//
//	printf("%s\n%d\n%s\n", stu.name, stu.grade, stu.gender);
//   return 0;
//}



#include <stdio.h>
struct Stu
{
	char name[10];
	int age;
	char* sex;
	double score;
};
//void set_age1(struct Stu stu) {
//	stu.age = 18;
//}
//
//void set_age2(struct Stu* pStu) {
//	pStu->age = 18;//结构成员访问
//}
int main()
{
	struct Stu stu;
	struct Stu* pStu = &stu;//结构成员访问
	//strcpy
	strcpy(stu.name, "赵亮");
	printf("%s\n", stu.name);
	//stu.name = "hi";//结构成员访问_数组
	printf("%s\n", stu.name);
	stu.sex = "hi";//字符指针
					//set_age1(stu);

	pStu->age = 20;//结构成员访问
	//set_age2(pStu);
	return 0;
}//#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
////逗号表达式
//struct student
//{
//	char name[20];
//	int grade;
//	char gender[10];
//};
//int main()
//{
//	struct student stu;
//	struct student* ps = &stu;
//	stu.name =  "花骨朵" ;
//
//	printf("%s\n%d\n%s\n", stu.name, stu.grade, stu.gender);
//   return 0;
//}



#include <stdio.h>
struct Stu
{
	char name[10];
	int age;
	char* sex;
	double score;
};
//void set_age1(struct Stu stu) {
//	stu.age = 18;
//}
//
//void set_age2(struct Stu* pStu) {
//	pStu->age = 18;//结构成员访问
//}
int main()
{
	struct Stu stu;
	struct Stu* pStu = &stu;//结构成员访问
	//strcpy
	strcpy(stu.name, "赵亮");
	printf("%s\n", stu.name);
	//stu.name = "hi";//结构成员访问_数组
	printf("%s\n", stu.name);
	stu.sex = "hi";//字符指针
					//set_age1(stu);

	pStu->age = 20;//结构成员访问
	//set_age2(pStu);
	return 0;
}